
lst = [2, 18, 20, 29, 38, 49, 56, 78]
# 查找49所在的位
def find(lst, t, left, right):
    if left <= right:
        mid = (left+right)//2
        if lst[mid] == t:
            return mid
        elif lst[mid] < t:
            return find(lst, t, mid+1, right)
        else:
            return find(lst, t, left, mid-1)
    else:
        return -1
print(find(lst,49, 0, len(lst)-1))


